﻿using HC.View;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using EMRView;
using EMRView.Extensions.HCAttribute;

namespace EMRView.Extensions.Command.StandardCommand.Edit
{
    [Command(CommandType.编辑, "SymmetryMargin", "对称页边距")]
    public class SymmetryMarginCommand : BaseCommand
    {
        private ToolStripButton _symmetryMarginButton;

        public override Icon CommandIcon
        {
            get
            {
                return Properties.HCResource.对称页边距;
            }
        }

        public override object Execute(HCEmrView _view, bool showDefaultUI = false, params object[] para)
        {
            var falg = !_view.SymmetryMargin;
            _view.SymmetryMargin = falg;
            _symmetryMarginButton.Checked = falg;

            return null;
        }

        public override void InitControl(object control)
        {
            if (control is ToolStripButton)
            {
                _symmetryMarginButton = control as ToolStripButton;
                _symmetryMarginButton.Checked = true;
            }
        }
    }
}
